hysop.operator.diffusion module

@file diffusion.py Diffusion operator generator.

class hysop.operator.diffusion.Diffusion(Fin, variables, nu, dt, Fout=None, implementation=None, base_kwds=None, **kwds)[source]

Bases: SpectralComputationalGraphNodeFrontend

Interface the diffusion solver. Available implementations are: FORTRAN: FFTW based solver (legacy fortran)

PYTHON: generic python fft based solver (pyfftw, scipy or numpy) OPENCL: generic opencl fft based solver (gpyfft)

Initialize a Poisson operator frontend. Solves dF/dt = nu * Laplacian(F)

Parameters:
  • Fin (field) – input field that should be diffused

  • Fout (field, optional, defaults to none) – output field that should be diffused. if None this will be set to Fin.

  • variables (dict) – dictionary of fields as keys and topologies as values.

  • nu (float or ScalarParameter) – Some implementations may only offer scalar nu.

  • dt (ScalarParameter) – Timestep parameter that will be used for time integration.

  • implementation (Implementation, optional, defaults to None) – target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().

  • base_kwds (dict, optional, defaults to None) – Base class keywords arguments. If None, an empty dict will be passed.

  • kwds – Keywords arguments that will be passed towards implementation poisson operator __init__.

Notes

A diffusion operator implementation should at least support the hysop.operator.base.diffusion.DiffusionBase interface.

classmethod default_implementation()[source]

Return the default Implementation, should be compatible with available_implementations.

classmethod implementations()[source]

Should return all implementations as a dictionnary. Keys are Implementation instances and values are either ComputationalGraphNode or ComputationalGraphNodeGenerator.